home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Cream of the Crop 26
/
Cream of the Crop 26.iso
/
program
/
tcqbsnip.zip
/
DAISIES.BAS
< prev
next >
Wrap
BASIC Source File
|
1997-06-20
|
2KB
|
73 lines
' Daisy Patch
' By Tika Carr
' June 20, 1997
'
' Public Domain: No warranties or Guarantees are expressed or implied
DECLARE SUB Daisies (Col%, Row%, Radius%, Aspect!, Colour%, Petals%)
DEFINT A-Z
SCREEN 12 ' 640 x 480 VGA
'Daisies x, y, Radius, Aspect, Color, Petals
LINE (0, 0)-(640, 480), 2, BF 'Clear Screen to green
PALETTE 1, 2965311 'Cream Petals
PALETTE 3, 2045759 'Gold Petals
FOR i = 1 TO 10 ' Put 10 daisies on the screen
x = INT(RND * 540) + 50
y = INT(RND * 380) + 50
s = INT(RND * 50) + 10
Daisies x, y, s, 1, 15, 10 ' White Petals
Daisies x, y, s, .5, 1, 10 ' Cream Petals
Daisies x, y, s, 3, 3, 10 ' Gold Petals
NEXT
BEEP ' Done!
P$ = INPUT$(1): SCREEN 0, 0, 0, 0: COLOR 7, 0: CLS : END
SUB Daisies (Col, Row, Radius, Aspect!, Colour, Petals)
'The original author of this subroutine is unknown. If anyone knows who
'wrote it, please let me know!
i = (360 \ Petals)
Pi2! = (8 * ATN(1))
Srad! = StartD! - (90 \ Petals) - 90
XRad! = Radius
YRad! = Radius
IF Aspect! > 1 THEN
XRad! = Radius / Aspect!
ELSEIF Aspect! < 1 THEN
YRad! = Radius * Aspect!
END IF
Srad! = Srad! + (180 \ Petals)
Sr! = Srad! * (Pi2! / 360)
PSET (Col, Row), Colour 'Start Point
FOR T! = .01 TO Pi2! STEP .01
'formula
L! = SIN(Petals * T!)
R! = XRad! * L!
x = Col + (R! * COS(T! - Sr!))
IF Aspect! <> 1 THEN R! = YRad! * L!
y = Row - (R! * SIN(T! - Sr!))
LINE -(x, y), Colour
NEXT
END SUB